package com.tjhzzx.danfossNiagaraCore.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @version 1.0
 * @date 2021-11-30 22:32
 */
public final class BEnergyCategoryType extends BFrozenEnum {
    public static final int COMMON = 0;
    public static final int POWER = 1;
    public static final int GAS = 2;
    public static final int ELECTRICITY = 3;
    public static final int WATER = 4;

    public static final BEnergyCategoryType common = new BEnergyCategoryType(0);
    public static final BEnergyCategoryType power = new BEnergyCategoryType(1);
    public static final BEnergyCategoryType gas = new BEnergyCategoryType(2);
    public static final BEnergyCategoryType electricity = new BEnergyCategoryType(3);
    public static final BEnergyCategoryType water = new BEnergyCategoryType(4);

    public static final BEnergyCategoryType DEFAULT = power;

    public BEnergyCategoryType(int ordinal) {
        super(ordinal);
    }

    public static BEnergyCategoryType make(int ordinal) {
        return (BEnergyCategoryType) power.getRange().get(ordinal, false);
    }

    public static BEnergyCategoryType make(String tag) {
        return (BEnergyCategoryType) power.getRange().get(tag);
    }

    public static String expose() {
        return "{\"COMMON\":0, \"POWER\":1, \"GAS\":2, \"ELECTRICITY\":3, \"WATER\":4}";
    }

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BEnergyCategoryType.class);
}